package com.mineapp.model

import android.os.Parcel
import android.os.Parcelable

/**
 * 首页分类列表实体类
 */
class Catergory() : Parcelable {
    // DmId
    var dmId: String? = null
    // 图片地址
    var icon: String? = null
    //点击跳转地址
    var linkUrl: String? = null
    //标签名字
    var areaName: String? = null
    //0开放 1关闭
    var isOpen: Int = 0
    //文字提示
    var promptText: String? = null
    //用户类型1:个人 2:商家
    var userType: Int = 0
    //类型id
    var categoryId: String? = null
    //是否居中显示,0不居中，1居中
    var isCenter: Int = 0

    //图片地址
    var areaPic: String? = null

    //状态
    var status: Int = 0
    var skipMethod: String? = null

    constructor(parcel: Parcel) : this() {
        dmId = parcel.readString()
        icon = parcel.readString()
        linkUrl = parcel.readString()
        areaName = parcel.readString()
        isOpen = parcel.readInt()
        promptText = parcel.readString()
        userType = parcel.readInt()
        categoryId = parcel.readString()
        isCenter = parcel.readInt()
        areaPic = parcel.readString()
        status = parcel.readInt()
        skipMethod = parcel.readString()
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(dmId)
        parcel.writeString(icon)
        parcel.writeString(linkUrl)
        parcel.writeString(areaName)
        parcel.writeInt(isOpen)
        parcel.writeString(promptText)
        parcel.writeInt(userType)
        parcel.writeString(categoryId)
        parcel.writeInt(isCenter)
        parcel.writeString(areaPic)
        parcel.writeInt(status)
        parcel.writeString(skipMethod)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<Catergory> {
        override fun createFromParcel(parcel: Parcel): Catergory {
            return Catergory(parcel)
        }

        override fun newArray(size: Int): Array<Catergory?> {
            return arrayOfNulls(size)
        }
    }

}
